/**
 * 
 */
package com.lib724.web.controller;

import java.util.HashMap;
import java.util.Map;

import com.javaeedev.lightweight.mvc.ModelAndView;
import com.javaeedev.lightweight.mvc.SimpleController;
import com.javaeedev.lightweight.validate.Handle;
import com.javaeedev.lightweight.validate.Validate;
import com.javaeedev.lightweight.validate.ValidateNestedProperties;
import com.lib724.model.User;

/**
 *
 * @author xiaoli
 * 2009 下午08:05:31
 */
public class RegisterController extends SimpleController {
	@ValidateNestedProperties({@Validate(field="mobile.areacode", min=3, max=11, label="手机区号错误！")})
	User user;
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@Override
	public ModelAndView executeDefault() throws Exception {
		// TODO Auto-generated method stub
		return new ModelAndView("register2");
	}
	
	@Handle(view="register2", validate="")
	public ModelAndView add() {
		ModelAndView mv = new ModelAndView("register2_ok");
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("user", user);
		return new ModelAndView("register2_ok", map);
	}

}
